package com.kws.tool.config;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : zhangbenting
 * @date : 2024/10/24 21:29
 * @Version: 1.0
 */
@Configuration
public class AliyunPushConfig {

    @Value("${aliyun.push.region-id}")
    private String regionId;

    @Value("${aliyun.push.access-key-id}")
    private String accessKeyId;

    @Value("${aliyun.push.access-key-secret}")
    private String accessKeySecret;

    @Bean
    public DefaultAcsClient aliyunPushClient() {
        DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
        return new DefaultAcsClient(profile);
    }
}
